<?php

class Application_Form_Feedback extends Zend_Form {

    public function init() {
        $this->setMethod("post");

        #name
        $name = new Zend_Form_Element_Text('name');
        $name->setLabel("Name:")
                ->setRequired()
                ->setAttribs(array('placeholder' => 'Enter your full name', 'class' => 'span12', 'required' => 'required'))
                ->addFilter("StringTrim");

        #mobile
        $mobile = new Zend_Form_Element_Text('mobile');
        $mobile->setLabel("Mobile:")
                ->setRequired()
                ->setAttribs(array('placeholder' => 'Enter your mobile number', 'class' => 'span12', 'required' => 'required'))
                ->addFilter("StringTrim")
                ->addValidator('regex', false, array('/^[0-9 ]+$/'))
                ->setErrorMessages(array('You must enter digits only.'));
        #email
        $email = new Zend_Form_Element_Text('email');
        $email->setLabel("Email:")
                ->setRequired()
                ->setAttribs(array('placeholder' => 'Enter your email address', 'class' => 'span12', 'required' => 'required'))
                ->addValidator("EmailAddress")
                ->addFilter("StringTrim");

        #subject
        $subject = new Zend_Form_Element_Text('subject');
        $subject->setLabel("Subject:")
                ->setRequired()
                ->setAttribs(array('placeholder' => 'Enter subject', 'class' => 'span12', 'required' => 'required'))
                ->addFilter("StringTrim");

        #message
        $message = new Zend_Form_Element_Textarea('message');
        $message->setLabel("Message:")
                ->setAttribs(array('placeholder' => 'Enter your message here', 'rows' => '10', 'class' => 'span12', 'required' => 'required'))
                ->setRequired()
                ->addFilter("StringTrim");

        #submit
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel("Send Message")
                ->setAttribs(array('class' => 'btn btn-info'));



        #
        $this->addElements(array($name, $mobile, $email, $subject, $message, $submit));
    }

}

